#ifndef _RETRO_COLORWHEEL
#define _RETRO_COLORWHEEL

namespace Retro
{
  namespace Creator
  {
    namespace GUI
    {
      enum ColorWheelNotifyEvent
      {
        ColorWheelNotifySelection = 0x0001,
      };

      class ColorWheel : public Control
      {
      private:
        Geom::RGBColor  mRGBColor;
        Geom::HSVColor  mHSVColor;
        Gdip::Bitmap*   mColorWheel;
        Geom::Point     mCursorPos;
        UIState         mState;
        INT             mWheelRadius;

        VOID  getWheelBounds(Gdip::Rect& oBounds);
        VOID  getWheelCursorBounds(Gdip::Rect& oBounds);
        BOOL  hitTestWheel(const Geom::Point& iPoint);

      protected:
        virtual VOID  onControlPaint(ControlPaintEvent& iEvent);
        virtual VOID  onMouseDown(Event::MouseEvent& iEvent);
        virtual VOID  onMouseUp(Event::MouseEvent& iEvent);
        virtual VOID  onMouseMove(Event::MouseEvent& iEvent);
        virtual VOID  onMouseWheel(Event::MouseWheelEvent& iEvent);
        virtual VOID  onKeyDown(Event::KeyEvent& iEvent);
        virtual VOID  onFocus(Event::FocusEvent& iEvent);
        virtual VOID  onSize(Event::SizeEvent& iEvent);

      public:
        INL INT     getWheelRadius()
        {
          return mWheelRadius;
        }

        VOID  setWheelRadius(INT iValue);

        INL Geom::RGBColor  getColorRGB()
        {
          return mRGBColor;
        }

        INL Geom::HSVColor  getColorHSV()
        {
          return mHSVColor;
        }

        VOID  setColor(COLOR iValue);

        ColorWheel();
        ~ColorWheel();
      };
    } // namespace GUI
  } // namespace Creator
} // namespace Retro

#endif